<template>
  <div>
    <h4>HelloWorld</h4>
    <p>aaa: {{ aaa }}</p>
    <p>bbb: {{ bbb }}</p>
    <p>ccc: {{ ccc }}</p>
  </div>
</template>

<script>
import { inject } from 'vue'

export default {
  setup() {
    const aaa = inject('aaa')
    const bbb = inject('bbb')
    const ccc = inject('age')
    const ddd = inject('ddd', 100)

    console.log('aaa', aaa) // ’张三‘
    console.log('bbb', bbb) // '里斯'
    console.log('ccc', ccc) // Ref<10>
    console.log('ddd', ddd) // 100

    return {
      aaa,
      bbb,
      ccc
    }
  }
}
</script>
